package service;

import dao.OrderDao;
import dao.domain.Client;
import dao.domain.Order;
import dao.impl.OrderDaoImpl;

import java.sql.SQLException;
import java.util.List;

/**
 * @author gzb
 */

public class OrderService {
    private static final OrderDao ORDER_DAO = new OrderDaoImpl();

    public static Order selectById(int id) throws SQLException {
        return ORDER_DAO.selectById(id);
    }

    public static List<Order> selectByClient(Client client) throws SQLException {
        return ORDER_DAO.selectByClient(client);
    }

    public static List<Order> selectAll() throws SQLException {
        return ORDER_DAO.selectAll();
    }

    public static void delete(Order order) throws SQLException {
        ORDER_DAO.delete(order);
    }

    public static void save(Order order) throws SQLException {
        ORDER_DAO.save(order);
    }
}
